package com.zjsystem.zjsy.controller;

import com.zjsystem.zjsy.websocket.WebSocketServer;
import groovy.util.logging.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author terminal
 * @since 2024-07-18 10:19:19
 */
@Slf4j
@RestController
@RequestMapping("/web")
public class WebSocDemoController {

    @GetMapping("/demo")
    public boolean demo(@RequestParam("userId") String userId, @RequestParam("message") String mesage) {
        //给前端web推送数据
        WebSocketServer.sendInfo(userId, mesage);
        return true;
    }
}
